package cn.com.gainfo.recks.action.webpay;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import cn.yzyue.base.table.AbstractTable;
import cn.yzyue.base.table.TableProperty;
import cn.yzyue.base.table.impl.ColumnProperty;
import cn.yzyue.base.table.impl.CustomButton;
import cn.yzyue.base.table.impl.RowProperty;

@TableProperty(action = "umerch",keyColumnIndexs={0},startColumnIndex=1)
public class NumerchActionTable extends AbstractTable {

	public NumerchActionTable(HttpServletRequest request, HttpServletResponse response, HttpSession session){
		super(request, response, session);
	}
	
	@Override
	public RowProperty getRowProperty(String[] rowData) {
		RowProperty rp = new RowProperty();
		rp.setBgColor("ffffff");
		return rp;
	}
	
	@Override
	public ColumnProperty[] getColumnProperty() {
		ColumnProperty[] cps = new ColumnProperty[6];
		cps[0] = ColumnProperty.newFirstInstance(true, true);
		cps[0].setAlign("center");
		cps[1] = ColumnProperty.newDataInstance();
		cps[1].setAlign("center");
		cps[2] = ColumnProperty.newDataInstance();
		cps[2].setAlign("center");
		cps[3] = ColumnProperty.newDataInstance();
		cps[3].setAlign("center");
		cps[4] = ColumnProperty.newDataInstance();
		cps[4].setAlign("center");
		
		cps[5] = ColumnProperty.newUpdateInstance(null);
		cps[5].setAlign("center");
		
		return cps;
	}
	@Override
	public boolean enable (int columnIndex, String[] rowData) {
		
		if(columnIndex==5){
			if(((String)session.getAttribute("authstr")).indexOf("ABd")<=-1){ 
				return false;
			}
			return true;
		}
		
		
		return true;
		
	}

}

